package com.bjgzy.courselive.mvp.contract;

import android.app.Activity;

import com.eduhzy.ttw.commonsdk.entity.AliOrderData;
import com.eduhzy.ttw.commonsdk.entity.CommonData;
import com.eduhzy.ttw.commonsdk.entity.OrderPayStatus;
import com.eduhzy.ttw.commonsdk.entity.RightOrderInfo;
import com.eduhzy.ttw.commonsdk.entity.WXPayData;
import com.jess.arms.mvp.IModel;
import com.jess.arms.mvp.IView;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;

/**
 * @author xubo
 * @date 2018-8-3 13:44:39
 */
public interface OrderPayContract {
    //对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
    interface View extends IView {
        Activity getActivity();

        void update(RightOrderInfo data);

        void paySuccess();
    }

    //Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
    interface Model extends IModel {

        Observable<CommonData<List<RightOrderInfo>>>  saveRightOrder(Map<String, Object> map);

        Observable<CommonData<AliOrderData>> getAliPayOrderInfo(Map<String, Object> map);

        Observable<CommonData<WXPayData>>  getWxPayOrderInfo(Map<String, Object> map);

        Observable<CommonData<Map>>  orderPaid(Map<String,Object> map);

        Observable<CommonData<OrderPayStatus>>  getOrderPayStatus(Map<String,Object> map);
    }
}
